package org.javastudy.tang.vo;

/**
 * <p><em>Created on 2022/6/27 9:14 上午</em></p>
 *
 * @author fuzhongtang
 * @since 1.0.1
 */
public class User {
    public User() {
    }

    public User(String name, String sex, Integer age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    /**
     * 姓名
     */
    private String name;

    /**
     * 性别
     */
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    /**
     * 年龄
     */
    private Integer age;



    /**
     * 重写equals和hashCode
     */
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof User) {
            User user = (User) obj;
            if (name.equals(user.name)){
                return true;
            }
        }
        return false;
    }
    @Override
    public int hashCode () {
        return name.hashCode();
    }

}
